⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphics.h

📁 著名物理引擎Hawk的源代码
💻 H
字号:
/* graphics.h, HAWK game engine
 *
 * Copyright 1997-1998 by Phil Frisbie, Jr.
 * for Hawk Software
 *
 */

#ifndef GRAPHICS_H
#define GRAPHICS_H

#ifdef __cplusplus
extern "C" {
#endif

/* matrix types */
#define MODEL_MATRIX		0x0001
#define PROJECTION_MATRIX	0x0002

/* polygon types, same as OpenGL GL_* modes */
#define G_LINES				0x0001
#define G_LINE_LOOP			0x0002
#define G_TRIANGLES			0x0004
#define G_TRIANGLE_STRIP	0x0005
#define G_TRIANGLE_FAN		0x0006
#define G_QUADS				0x0007
#define G_QUAD_STRIP		0x0008
#define G_POLYGON			0x0009

/* alpha and depth functions */
#define G_NEVER				0x0200
#define G_LESS				0x0201
#define G_EQUAL				0x0202
#define G_LEQUAL			0x0203
#define G_GREATER			0x0204
#define G_NOTEQUAL			0x0205
#define G_GEQUAL			0x0206
#define G_ALWAYS			0x0207

/* blend functions */
#define G_ZERO					0
#define G_ONE					1
#define G_SRC_COLOR				0x0300
#define G_ONE_MINUS_SRC_COLOR	0x0301
#define G_SRC_ALPHA				0x0302
#define G_ONE_MINUS_SRC_ALPHA	0x0303
#define G_DST_ALPHA				0x0304
#define G_ONE_MINUS_DST_ALPHA	0x0305
#define G_DST_COLOR				0x0306
#define G_ONE_MINUS_DST_COLOR	0x0307
#define G_SRC_ALPHA_SATURATE	0x0308

/* texture modes */
#define G_MODULATE			0x2100
#define G_DECAL				0x2101
#define G_REPLACE			0x1E01

/* clear buffers */
#define G_DEPTH_BUFFER_BIT	0x0100
#define G_COLOR_BUFFER_BIT	0x4000


BOOL graphInit(void);
int graphNextTex(void);

void graphDepthTest(BOOL a);
void graphDepthFunc(int f);

void graphBlend(BOOL a);
void graphBlendFunc(int s, int d);

void graphTexture(BOOL a);
void graphTextureFunc(int f);

void graphAlpha(BOOL a);
void graphAlphaFunc(int f, float v);

void graphUseTexture(int tex);
void graphUseColor(unsigned char r, unsigned char g,
				   unsigned char b, unsigned char a);
int graphGetMaxTexSize(void);
void graphCreateTex(int level, int components, int w, int h, unsigned char *image);
void graphCaptureScreen(void);
void graphSetTexWrap(BOOL wrap);
void graphSetTexFilter(BOOL mipmap);
void graphSetViewport(float angle, int x, int y, int w, int h);
void graphLookAt(float eyex, float eyey, float eyez,
			float centerx, float centery, float centerz,
			float upx, float upy, float upz);
void graphBegin2D(void);
void graphRotate(float angle, float x, float y, float z);
void graphScale(float x, float y, float z);
void graphTranslate(float x, float y, float z);
void graphDraw(int mode, TPOINT *points, int start, int number);
void graphDrawLightmap(int mode, TPOINT *points, int start, int number);
void graphDrawParticles(void);
void graphClearBuffers(int buffer);
void graphSetClearColor(unsigned char r, unsigned char g,
				   unsigned char b, unsigned char a);
void graphClearMatrix(int m);
void graphBeginObject(void);

#ifdef __cplusplus
}
#endif


#endif /* GRAPHICS_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -