资源简介
计算机图形学基础第2版[陆枫]程序源代码

代码片段和文件信息
/* Copyright (c) Mark J. Kilgard 1994. */
/* This program is freely distributable without licensing fees
and is provided without guarantee or warrantee expressed or
implied. This program is -not- in the public domain. */
/* capturexfont.c connects to an X server and downloads a
bitmap font from which a C source file is generated
encoding the font for GLUT‘s use. Example usage:
capturexfont.c 9x15 glutBitmap9By15 > glut_9x15.c */
#include
#include
#include
#include
#include
#include
#include
#define MAX_GLYPHS_PER_GRAB 512 /* This is big enough for 2^9
glyph character sets */
static void
outputChar(int num int width int height
int xoff int yoff int advance int data)
{
if (width == 0 || height == 0) {
printf(“#ifdef _WIN32\n“);
printf(“/* XXX Work around Microsoft OpenGL 1.1 bug where glBitmap with\n“);
printf(“ a height or width of zero does not advance the raster position\n“);
printf(“ as specified by OpenGL. (Cosmo OpenGL does not have this bug.) */\n“);
printf(“static const GLubyte ch%ddata[] = { 0x0 };\n“ num);
printf(“static const BitmapCharRec ch%d = {“ num);
printf(“%d“ 0);
printf(“%d“ 0);
printf(“%d“ xoff);
printf(“%d“ yoff);
printf(“%d“ advance);
printf(“ch%ddata“ num);
printf(“};\n“);
printf(“#else\n“);
}
printf(“static const BitmapCharRec ch%d = {“ num);
printf(“%d“ width);
printf(“%d“ height);
printf(“%d“ xoff);
printf(“%d“ yoff);
printf(“%d“ advance);
if (data) {
printf(“ch%ddata“ num);
} else {
printf(“0“);
}
printf(“};\n“);
if (width == 0 || height == 0) {
printf(“#endif\n“);
}
printf(“\n“);
}
/* Can‘t just use isprint because it only works for the range
of ASCII characters (ie TRUE for isascii) and capturexfont
might be run on 16-bit fonts. */
#define PRINTABLE(ch) (isascii(ch) ? isprint(ch) : 0)
void
captureXFont(Display * dpy Font font char *xfont char *name)
{
int first last count;
int cnt len;
Pixmap offscreen;
Window drawable;
XFontStruct *fontinfo;
XImage *image;
GC xgc;
XGCValues values;
int width height;
int i j k;
XCharStruct *charinfo;
XChar2b character;
GLubyte *bitmapData;
int x y;
int spanLength;
int charWidth charHeight maxSpanLength pixwidth;
int grabList[MAX_GLYPHS_PER_GRAB];
int glyphsPerGrab = MAX_GLYPHS_PER_GRAB;
int numToGrab;
int rows pages byte1 byte2 index;
int nullBitmap;
drawable = RootWindow(dpy DefaultScreen(dpy));
fontinfo = XQueryFont(dpy font);
pages = fontinfo->max_char_or_byte2 - fontinfo->min_char_or_byte2 + 1;
first = (fontinfo->min_byte1 << 8) + fontinfo->min_char_or_byte2;
last = (fontinfo->max_byte1 << 8) + fontinfo->max_char_or_byte2;
count = last - first + 1;
width = fontinfo->max_bounds.rbearing -
fontinfo->min_bounds.lbearing;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2008-11-05 11:05 OpenGL程序\
目录 0 2008-11-03 23:42 OpenGL程序\OpenGL程序\
目录 0 2008-11-03 23:42 OpenGL程序\OpenGL程序\dll\
文件 315904 1997-11-21 17:01 OpenGL程序\OpenGL程序\dll\glu.dll
文件 119568 2000-01-10 12:00 OpenGL程序\OpenGL程序\dll\glu32.dll
文件 180224 1999-07-29 15:48 OpenGL程序\OpenGL程序\dll\GLUT32.DLL
文件 1214464 1997-11-21 17:01 OpenGL程序\OpenGL程序\dll\opengl.dll
文件 692496 2002-07-22 12:05 OpenGL程序\OpenGL程序\dll\OPENGL32.DLL
目录 0 2008-11-03 23:42 OpenGL程序\OpenGL程序\include\
目录 0 2008-11-03 23:42 OpenGL程序\OpenGL程序\include\gl\
文件 60468 1998-08-13 02:54 OpenGL程序\OpenGL程序\include\gl\FGL.H
文件 7273 1998-08-13 02:54 OpenGL程序\OpenGL程序\include\gl\FGLU.H
文件 10152 1998-08-13 02:54 OpenGL程序\OpenGL程序\include\gl\FGLUT.H
文件 71555 1997-11-07 02:34 OpenGL程序\OpenGL程序\include\gl\gl.h
文件 5150 1998-08-13 02:54 OpenGL程序\OpenGL程序\include\gl\GLSMAP.H
文件 14367 1997-10-31 02:18 OpenGL程序\OpenGL程序\include\gl\glu.h
文件 20844 1998-08-13 02:54 OpenGL程序\OpenGL程序\include\gl\GLUT.H
文件 8874 1998-08-13 02:54 OpenGL程序\OpenGL程序\include\gl\TUBE.H
目录 0 2008-11-03 23:42 OpenGL程序\OpenGL程序\lib\
文件 35606 1997-10-31 02:18 OpenGL程序\OpenGL程序\lib\glu.lib
目录 0 2008-11-03 23:42 OpenGL程序\OpenGL程序\lib\GLUT\
文件 11056 1998-08-13 02:49 OpenGL程序\OpenGL程序\lib\GLUT\capturexfont.c
文件 2277 1998-08-13 02:46 OpenGL程序\OpenGL程序\lib\GLUT\GLUT.DEF
文件 180224 1999-07-29 15:48 OpenGL程序\OpenGL程序\lib\GLUT\GLUT32.DLL
文件 17306 1999-07-29 15:48 OpenGL程序\OpenGL程序\lib\GLUT\GLUT32.EXP
文件 27096 1999-07-29 15:48 OpenGL程序\OpenGL程序\lib\GLUT\GLUT32.LIB
文件 708 1998-08-13 02:54 OpenGL程序\OpenGL程序\lib\GLUT\glutbitmap.h
文件 28061 1998-08-13 02:54 OpenGL程序\OpenGL程序\lib\GLUT\GLUTINT.H
文件 938 1998-08-13 02:54 OpenGL程序\OpenGL程序\lib\GLUT\glutstroke.h
文件 1752 1998-08-13 02:54 OpenGL程序\OpenGL程序\lib\GLUT\glutwin32.h
文件 38739 1998-08-13 02:49 OpenGL程序\OpenGL程序\lib\GLUT\glut_8x13.c
............此处省略81个文件信息
- 上一篇:iOS版CHM阅读器源码
- 下一篇:Rtmp Flash播放器 3.5
相关资源
- 中国1:400万基础地理数据
- 《Visual Prolog 基础类》 中文参考.chm
- 计算机图形学 边填充算法实现代码
- 计算机图形学课设 画板
- 80X86汇编语言基础教程(光盘内容)
- 计算机专业基础综合知识
- 简易绘图程序(计算机图形学课程设
- 复旦大学出版社 李贤平 《概率论基础
- ATA(ATAPI)接口指令协议硬盘基础知识
- 计算机图形学(openGL)代码
- 图形学集成程序dda、中点算法、多边
- 计算机图形实验(哈尔滨工程大学)
- EPLAN Electric P8 入门教程
- Vivado2019.2 lic 基础的都可以用
- Virtuoso版图设计基础教程
- 技术基础科学领域科技创新群体的科
- dcdc电源模块安装图解
- PLL回路滤波器设计的调整指南
- 建立在Sun平台上的高性能计算基础设
- 新员工IT基础知识培训PPT
- 虚拟化架构助力苏州地税创新IT基础架
- 记苏州地税创新IT基础架构应用
- 电机型号Y、YS、YSF、YT、YC字母的含义
- HGE基础教程
- Sun 系统为NewEnergy 网格基础架构带来活
- 虚拟化iSCSI SAN:实现虚拟化基础架构
- 大话处理器:处理器基础知识读本高
- 软件测试技术大全:测试基础、流行
- 计算机视觉教程(第2版)
- 基于Sun基础架构创建高可用灾难恢复
评论
共有 条评论