《光线游戏引擎 1.83 版》函数说明
屏幕显示函数:
注意:在使用下列函数之前,必须调用
gSetDisplayMode 或 gSetWindowMode 设置显示模式。
这些函数有:
屏幕显示函数、图像函数、文字函数、视频(音频)函数
设置游戏显示模式
int gSetDisplayMode( int width, int height, int color, int refurbish, int api);
设置窗口游戏模式
int gSetWindowMode( int x, int y, int width, int height, int api);
清除游戏窗口
void gClearDisplay(void);
更新游戏窗口显示内容
void gUpdateDisplay(void);
查询每秒钟显示的帧数
int gGetFramePerSecond( void );
设置作图颜色(对文字函数和几何图形函数都有效)
void gColor( int red, int green, int blue );
设置关键色(透明色)
int gSetColorKey( int red, int green, int blue );
图像函数:
支持关键色(透明色),由
int gSetColorKey( int red, int green, int blue ) 指定,缺省为黑色。
将图像文件读入内存
int gImageLoad( const char *filename );
在指定位置显示图像
int gImageDraw( int x, int y, int image );
显示指定区域的图像
int gImageRect(int dx, int dy, int sx, int sy, int width, int height, int image);
按指定角度旋转并显示图像
int gImageRotate( int x, int y, float angle, int image );
按指定百分比混合并显示图像
int gImageBlend( int x, int y, float alpha, int image );
按指定亮度显示图像
int gImageLighteness( int x, int y, float lighteness, int image );
将图像缩放到指定区域
int gImageScale( int left, int top, int right, int bottom, int image );
按指定的方向翻转并显示图像
int gImageReversal( int x, int y, bool horizontal, bool vertical, int image );
查询图像的宽度和高度
int gGetImageSize( LPPOINT lpPoint, int hImage );
从内存中释放图像
void gImageFree( int image );
声音函数:
支持 WAV 和 MIDI 格式,支持同时播放多个声音(混音)。
注意:在使用声音函数之前,必须调用
gSoundInitial 函数初始化声音硬件。
在游戏退出之前,必须调用
gSoundRelease 释放声音硬件。
初始化声音设备
int gSoundInitial(void);
读入声音文件(支持 WAV 和 MIDI 格式)
int gSoundLoad(const char *filename);
设置重复播放次数
int gSoundRepeats( int sound, int repeats );
播放
int gSoundPlay(int sound, int repeat);
暂停播放
int gSoundPause(int sound);
停止播放
int gSoundStop(int sound);
释放音乐(MIDI)和声音(WAV)文件所占内存
void gSoundFree(int sound);
释放声音设备
int gSoundRelease(void);
视频(音频)函数:
可以播放 MPEG2、AVI、MP3、WAV、MIDI等大部分常见的视频、音频文件,
并可以设定播放窗口。
播放状态
G_STATE_STOPPED 停止
G_STATE_PAUSED 暂停
G_STATE_PLAYING 播放
打开视频(音频)文件
(支持 MPEG2、AVI、MP3、WAV、MIDI等大部分常见的视频、音频文件)
int gVideoOpen(const char *FileName);
设置重复播放次数
int gVideoRepeats( int repeats );
设置播放位置
int gVideoSeek( double pos );
播放
int gVideoPlay(void);
暂停播放
int gVideoPause(void);
停止播放
int gVideoStop(void);
查询播放状态
int gVideoState(void);
关闭视频(音频)文件
int gVideoClose(void);
设置播放窗口(全局有效)
int gVideoSetWindow(int left, int top, int right, int botton);
文字函数:
(采用高速缓冲技术,完美支持高品质、高速度汉字显示,可以设定各种字体风格)
文字背景显示模式定义
G_TRANSPARENT 透明的
G_OPAQUE 不透明的
设置字体
int gSetFont( const char *FontName, // 指定字体
int Height, // 指定字体高度
int Width, // 指定字体宽度
int Weight, // 指定字体的重量
int Escapement, // 指定角度(1/10度)
bool Italic, // 指定是否斜体
bool Underline, // 指定是否有下划线
bool StrikeOut, // 指定是否有删除线
int Quality // 指定输出质量
);
显示指定的文字
void gDrawText( const char *lpString );
设置文字背景混合模式
int gSetBackMode( int mode );
设置当前文字背景色
void gBackColor( int red, int green, int blue );
设置文字显示位置
void gSetTextPos( int x, int y );
设置字符间距
int gSetCharSpace( int space );
输入函数:
支持缓冲模式和立即模式,支持键盘和鼠标。
初始化输入设备(支持键盘、鼠标)
int gInputInitial( void );
读取一个按键
unsigned long gGetKey( void );
查询光标位置
unsigned long gGetCursorPos( void );
设置光标位置
bool gSetCursorPos( int x, int y );
查询按键状态
long gGetKeyState( unsigned long key );
释放输入设备
int gInputRelease( void );
几何图形:
画几何图形,颜色由 void gColor( int red, int green, int blue ) 函数指定。
画点
void gPixel( int x, int y );
画线段
void gLine( int x1, int y1, int x2, int y2 );
画矩形
void gRect( int x1, int y1, int x2, int y2 );
读取点的颜色值
unsigned long gGetPixel( int x, int y );
状态函数:
用于查询窗口句柄、充许(禁止)关键色和设定窗口标题。
查询窗口句柄
HWND gGetWindowHandle( void );
G_WINDOW_CAPTION 窗口标题
设置指定字符串
bool gSetString( int name, const char *string );
G_COLOR_KEY 关键色(透明色)
充许指定功能
void gEnable( int name );
禁止指定功能
void gDisable( int name );
高精度时间函数:
查询系统启动以来经过的千分之一秒数
unsigned long gGetTickCount( void );
消息函数:
接收并处理消息
bool gDispatchMessage( void );
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
light1.83.rar (85个子文件)
light
使用说明.txt 3KB
bin
显示文字.exe 104KB
窗口标题.exe 104KB
键盘鼠标.exe 104KB
几何图形.exe 104KB
engine.dll 156KB
播放 MP3.exe 104KB
播放声音.exe 104KB
播放 MIDI.exe 104KB
显示图像.exe 120KB
播放视频.exe 104KB
全屏模式.exe 104KB
include
state.h 607B
image.h 1KB
engine.h 502B
draw.h 550B
display.h 1KB
text.h 1KB
input.h 11KB
sound.h 793B
time.h 396B
video.h 1KB
resource
canyon.mid 33KB
b.bmp 48KB
music.mp3 299KB
destory.wav 336KB
c.bmp 48KB
d.bmp 48KB
e.bmp 192KB
colorkey.bmp 48KB
lake.mpg 999KB
a.bmp 48KB
start.wav 475KB
example
几何图形
main.cpp 614B
几何图形.sln 905B
几何图形.suo 8KB
几何图形.ncb 59KB
几何图形.vcproj 3KB
播放 MIDI
main.cpp 692B
播放 MIDI.ncb 67KB
播放 MIDI.vcproj 3KB
播放 MIDI.suo 8KB
播放 MIDI.sln 907B
播放视频
main.cpp 537B
播放视频.suo 8KB
播放视频.vcproj 3KB
播放视频.ncb 483KB
播放视频.sln 905B
播放 MP3
main.cpp 689B
播放 MP3.suo 9KB
播放 MP3.vcproj 3KB
播放 MP3.ncb 475KB
播放 MP3.sln 905B
显示图像
main.cpp 2KB
显示图像.vcproj 3KB
显示图像.sln 905B
显示图像.ncb 579KB
显示图像.suo 8KB
全屏模式
main.cpp 703B
全屏模式.vcproj 3KB
全屏模式.ncb 123KB
全屏模式.sln 905B
全屏模式.suo 8KB
窗口标题
main.cpp 994B
窗口标题.vcproj 3KB
窗口标题.ncb 59KB
窗口标题.suo 8KB
窗口标题.sln 905B
播放声音
main.cpp 860B
播放声音.ncb 483KB
播放声音.suo 8KB
播放声音.sln 905B
播放声音.vcproj 3KB
显示文字
main.cpp 2KB
显示文字.vcproj 3KB
显示文字.suo 8KB
显示文字.ncb 475KB
显示文字.sln 905B
键盘鼠标
main.cpp 1KB
键盘鼠标.suo 9KB
键盘鼠标.vcproj 3KB
键盘鼠标.ncb 275KB
键盘鼠标.sln 905B
函数说明.txt 6KB
lib
engine.lib 29KB
共 85 条
- 1
资源评论
kangxu
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功