texture.h
来自「一本关于OPenGL的很好的电子书」· C头文件 代码 · 共 53 行
H
53 行
#ifndef __TEXTURE_H
#define __TEXTURE_H
#include <stdio.h>
#include <iostream.h>
#include <windows.h>
#include <commctrl.h>
#include <windowsx.h>
#include <gl/gl.h>
#include <gl/glu.h>
enum texTypes_t
{
PCX,
BMP,
TGA
};
typedef struct
{
// C Compatible version: enum texTypes textureType;
// We use C++ only version
texTypes_t textureType;
int width; // width of texture
int height; // height of texture
long int scaledWidth;
long int scaledHeight;
unsigned int texID; // the texture object id of this texture
unsigned char *data; // the texture data
unsigned char *palette;
} texture_t;
// only partial pcx file header
typedef struct
{
unsigned char manufacturer;
unsigned char version;
unsigned char encoding;
unsigned char bits;
unsigned char xMin;
unsigned char yMin;
unsigned char xMax;
unsigned char yMax;
unsigned char *palette;
} PCXHEADER;
texture_t *LoadTexture(char *filename);
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?