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

📄 t3dlib10.h

📁 3D游戏编程大师技巧第十二章的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
void Draw_Textured_TriangleFSZB_Alpha16(POLYF4DV2_PTR face, // ptr to face
                                 UCHAR *_dest_buffer, // pointer to video buffer
                                 int mem_pitch,       // bytes per line, 320, 640 etc.
                                 UCHAR *zbuffer,      // pointer to z-buffer
                                 int zpitch,          // bytes per line of zbuffer
                                 int alpha);

void Draw_Textured_TriangleGSZB_Alpha16(POLYF4DV2_PTR face,   // ptr to face
                                 UCHAR *_dest_buffer, // pointer to video buffer
                                 int mem_pitch,       // bytes per line, 320, 640 etc.
                                 UCHAR *_zbuffer,     // pointer to z-buffer
                                 int zpitch,          // bytes per line of zbuffer
                                 int alpha);


void Draw_Triangle_2DZB_Alpha16(POLYF4DV2_PTR face, // ptr to face
                           UCHAR *_dest_buffer, // pointer to video buffer
                           int mem_pitch,       // bytes per line, 320, 640 etc.
                           UCHAR *zbuffer,      // pointer to z-buffer
                           int zpitch,          // bytes per line of zbuffer
                           int alpha);

void Draw_Gouraud_TriangleZB_Alpha16(POLYF4DV2_PTR face,   // ptr to face
                              UCHAR *_dest_buffer, // pointer to video buffer
                              int mem_pitch,       // bytes per line, 320, 640 etc.
                              UCHAR *zbuffer,      // pointer to z-buffer
                              int zpitch,          // bytes per line of zbuffer
                              int alpha);


void Draw_RENDERLIST4DV2_SolidZB_Alpha16(RENDERLIST4DV2_PTR rend_list, 
                                   UCHAR *video_buffer, 
	   						       int lpitch,
                                   UCHAR *zbuffer,
                                   int zpitch,
                                   int alpha_override);
                                  

// 1/z buffered and alpha
void Draw_Textured_TriangleINVZB_Alpha16(POLYF4DV2_PTR face,  // ptr to face
                              UCHAR *_dest_buffer, // pointer to video buffer
                              int mem_pitch,       // bytes per line, 320, 640 etc.
                              UCHAR *zbuffer,      // pointer to z-buffer
                              int zpitch,          // bytes per line of zbuffer
                              int alpha);

void Draw_Textured_TriangleFSINVZB_Alpha16(POLYF4DV2_PTR face, // ptr to face
                                 UCHAR *_dest_buffer, // pointer to video buffer
                                 int mem_pitch,       // bytes per line, 320, 640 etc.
                                 UCHAR *zbuffer,      // pointer to z-buffer
                                 int zpitch,          // bytes per line of zbuffer
                                 int alpha);

void Draw_Textured_TriangleGSINVZB_Alpha16(POLYF4DV2_PTR face,   // ptr to face
                                 UCHAR *_dest_buffer, // pointer to video buffer
                                 int mem_pitch,       // bytes per line, 320, 640 etc.
                                 UCHAR *_zbuffer,     // pointer to z-buffer
                                 int zpitch,          // bytes per line of zbuffer
                                 int alpha);


void Draw_Triangle_2DINVZB_Alpha16(POLYF4DV2_PTR face, // ptr to face
                           UCHAR *_dest_buffer, // pointer to video buffer
                           int mem_pitch,       // bytes per line, 320, 640 etc.
                           UCHAR *zbuffer,      // pointer to z-buffer
                           int zpitch,          // bytes per line of zbuffer
                           int alpha);

void Draw_Gouraud_TriangleINVZB_Alpha16(POLYF4DV2_PTR face,   // ptr to face
                              UCHAR *_dest_buffer, // pointer to video buffer
                              int mem_pitch,       // bytes per line, 320, 640 etc.
                              UCHAR *zbuffer,      // pointer to z-buffer
                              int zpitch,          // bytes per line of zbuffer
                              int alpha);

void Draw_Textured_Perspective_Triangle_INVZB_Alpha16(POLYF4DV2_PTR face,  // ptr to face
                                                   UCHAR *_dest_buffer, // pointer to video buffer
                                                   int mem_pitch,       // bytes per line, 320, 640 etc.
                                                   UCHAR *_zbuffer,     // pointer to z-buffer
                                                   int zpitch,          // bytes per line of zbuffer
                                                   int alpha);


void Draw_Textured_PerspectiveLP_Triangle_INVZB_Alpha16(POLYF4DV2_PTR face,  // ptr to face
                                                        UCHAR *_dest_buffer, // pointer to video buffer
                                                        int mem_pitch,       // bytes per line, 320, 640 etc.
                                                        UCHAR *_zbuffer,     // pointer to z-buffer
                                                        int zpitch,          // bytes per line of zbuffer
                                                        int alpha);

void Draw_Textured_Perspective_Triangle_FSINVZB_Alpha16(POLYF4DV2_PTR face,  // ptr to face
                                                   UCHAR *_dest_buffer, // pointer to video buffer
                                                   int mem_pitch,       // bytes per line, 320, 640 etc.
                                                   UCHAR *_zbuffer,     // pointer to z-buffer
                                                   int zpitch,          // bytes per line of zbuffer
                                                   int alpha);

void Draw_Textured_PerspectiveLP_Triangle_FSINVZB_Alpha16(POLYF4DV2_PTR face,  // ptr to face
                                                   UCHAR *_dest_buffer, // pointer to video buffer
                                                   int mem_pitch,       // bytes per line, 320, 640 etc.
                                                   UCHAR *_zbuffer,     // pointer to z-buffer
                                                   int zpitch,          // bytes per line of zbuffer
                                                   int alpha);


void Draw_RENDERLIST4DV2_SolidINVZB_Alpha16(RENDERLIST4DV2_PTR rend_list, 
                                   UCHAR *video_buffer, 
	   						       int lpitch,
                                   UCHAR *zbuffer,
                                   int zpitch,
                                   int alpha_override);


// non zbuffered versions
void Draw_Textured_Triangle2_16(POLYF4DV2_PTR face, // ptr to face
                              UCHAR *_dest_buffer,  // pointer to video buffer
                              int mem_pitch);       // bytes per line, 320, 640 etc.


void Draw_Textured_Bilerp_Triangle_16(POLYF4DV2_PTR face, // ptr to face
                                      UCHAR *_dest_buffer,  // pointer to video buffer
                                      int mem_pitch);       // bytes per line, 320, 640 etc.

void Draw_Textured_TriangleFS2_16(POLYF4DV2_PTR face, // ptr to face
                                 UCHAR *_dest_buffer, // pointer to video buffer
                                 int mem_pitch);      // bytes per line, 320, 640 etc.


void Draw_Triangle_2D3_16(POLYF4DV2_PTR face,  // ptr to face
                           UCHAR *_dest_buffer,// pointer to video buffer
                           int mem_pitch);     // bytes per line, 320, 640 etc.


void Draw_Gouraud_Triangle2_16(POLYF4DV2_PTR face, // ptr to face
                              UCHAR *_dest_buffer, // pointer to video buffer
                              int mem_pitch);      // bytes per line, 320, 640 etc.



void Draw_Textured_TriangleGS_16(POLYF4DV2_PTR face,  // ptr to face
                                 UCHAR *_dest_buffer, // pointer to video buffer
                                 int mem_pitch);      // bytes per line, 320, 640 etc.

void Draw_Textured_Perspective_Triangle_16(POLYF4DV2_PTR face,  // ptr to face
                                                   UCHAR *_dest_buffer, // pointer to video buffer
                                                   int mem_pitch);      // bytes per line, 320, 640 etc.


void Draw_Textured_PerspectiveLP_Triangle_16(POLYF4DV2_PTR face,  // ptr to face
                                                   UCHAR *_dest_buffer, // pointer to video buffer
                                                   int mem_pitch);      // bytes per line, 320, 640 etc.

void Draw_Textured_Perspective_Triangle_FS_16(POLYF4DV2_PTR face,  // ptr to face
                                                   UCHAR *_dest_buffer, // pointer to video buffer
                                                   int mem_pitch);      // bytes per line, 320, 640 etc.

void Draw_Textured_PerspectiveLP_Triangle_FS_16(POLYF4DV2_PTR face,  // ptr to face
                                                   UCHAR *_dest_buffer, // pointer to video buffer
                                                   int mem_pitch);      // bytes per line, 320, 640 etc.


void Draw_RENDERLIST4DV2_Solid2_16(RENDERLIST4DV2_PTR rend_list, 
                                   UCHAR *video_buffer, 
	   						       int lpitch);


// alpha versions, non-z buffered
int RGB_Alpha_Table_Builder(int num_alpha_levels,   // number of levels to create
                            USHORT rgb_alpha_table[NUM_ALPHA_LEVELS][65536]); // lookup table


void Draw_Triangle_2D_Alpha16(POLYF4DV2_PTR face,  // ptr to face
                              UCHAR *_dest_buffer, // pointer to video buffer
                              int mem_pitch,       // bytes per line, 320, 640 etc.
                              int alpha);
void Draw_Textured_Triangle_Alpha16(POLYF4DV2_PTR face,  // ptr to face
                              UCHAR *_dest_buffer,  // pointer to video buffer
                              int mem_pitch,        // bytes per line, 320, 640 etc.
                              int alpha);

void Draw_Textured_TriangleFS_Alpha16(POLYF4DV2_PTR face, // ptr to face
                                 UCHAR *_dest_buffer,  // pointer to video buffer
                                 int mem_pitch,        // bytes per line, 320, 640 etc.
                                 int alpha);


void Draw_Textured_TriangleGS_Alpha16(POLYF4DV2_PTR face,  // ptr to face
                                      UCHAR *_dest_buffer, // pointer to video buffer
                                      int mem_pitch,       // bytes per line, 320, 640 etc.
                                      int alpha);


void Draw_Gouraud_Triangle_Alpha16(POLYF4DV2_PTR face,   // ptr to face
                              UCHAR *_dest_buffer, // pointer to video buffer
                              int mem_pitch,       // bytes per line, 320, 640 etc.
                              int alpha);


void Draw_RENDERLIST4DV2_Solid_Alpha16(RENDERLIST4DV2_PTR rend_list, 
                                   UCHAR *video_buffer, 
	   						       int lpitch, 
                                   int alpha_override);


// new rendering function that works for everything!!! yaaa!!!!!
void Draw_RENDERLIST4DV2_RENDERCONTEXTV1_16(RENDERCONTEXTV1_PTR rc);

void Transform_RENDERLIST4DV2(RENDERLIST4DV2_PTR rend_list, // render list to transform
                              MATRIX4X4_PTR mt,   // transformation matrix
                              int coord_select);   // selects coords to transform

// new model functions 
int Load_OBJECT4DV2_COB2(OBJECT4DV2_PTR obj, // pointer to object
                         char *filename,     // filename of Caligari COB file
                         VECTOR4D_PTR scale, // initial scaling factors
                         VECTOR4D_PTR pos,   // initial position
                         VECTOR4D_PTR rot,   // initial rotations
                         int vertex_flags,   // flags to re-order vertices 
                                             // and perform transforms
                         int mipmap=0);      // mipmap enable flag
                                             // 0 means no mipmap, 1 means
                                             // generate mip map

int Generate_Terrain2_OBJECT4DV2(OBJECT4DV2_PTR obj,   // pointer to object
                                float twidth,          // width in world coords on x-axis
                                float theight,         // height (length) in world coords on z-axis
                                float vscale,          // vertical scale of terrain
                                char *height_map_file, // filename of height bitmap encoded in 256 colors
                                char *texture_map_file,// filename of texture map
                                int rgbcolor,          // color of terrain if no texture        
                                VECTOR4D_PTR pos,      // initial position
                                VECTOR4D_PTR rot,      // initial rotations
                                int poly_attr,         // the shading attributes we would like
                                float sea_level=-1,    // height of sea level
                                int alpha=-1);         // alpha level for sea polygons 

// new directdraw functions
int DDraw_Init2(int width, int height, int bpp, int windowed, int backbuffer_enable = 1);
int DDraw_Flip2(void);

// mip mapping functions
int Generate_Mipmaps(BITMAP_IMAGE_PTR source, BITMAP_IMAGE_PTR *mipmaps, float gamma = 1.01);
int Delete_Mipmaps(BITMAP_IMAGE_PTR *mipmaps, int leave_level_0);

#endif

⌨️ 快捷键说明

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